//
//  NSArray+WLExtension.m
//  LookNovel
//
//  Created by chuangqi on 2021/3/15.
//  Copyright © 2021 cq Co.,ltd. All rights reserved.
//

#import "NSArray+WLExtension.h"

@implementation NSArray (WLExtension)

/** 从数组中随机取N个 */
-(NSArray *)getRandomForCount:(int)count{
    NSMutableArray *array = [NSMutableArray array];
    while (array.count < count) {
        int x = arc4random() % self.count;
        [array addObject:[self objectAtIndex:x]];
    }
    return array;
}
@end
